/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityGameObject;

import Supporter.GlobalVariables;
import java.util.Vector;

/**
 *
 * @author Van persie
 */
public class Pet  extends AbsEntityGameObject{
    
    public static  final int EXP = 0;
    public static  final int LEVEL = 1;
    public static  final int POINTS = 2;
    public static  final int SPEED = 3;
    public static  final int TONGUELEN = 4;
    public static  final int MONEY = 5;
    
        
    public static final int EMOTION_SAD = 0;
    public static final int EMOTION_HAPPY = 1;   
    
    public static final int STATUS_HUNGRY = 2;
    public static final int STATUS_FULL = 3;  
    
    public static final int TIRED = 4;
    
    public static final int NORMAL = 4;
    
    int exp;
    int level;
    int points;
    private int emotion;
    private boolean isHappy;
    private boolean isFull;
    private int status;
    private boolean  isTired;
    
    private int speech;
    private int tongueLen;
    private int money;
    private int stamina;
    
    private String name;
    
    
    private Vector listItems = null;
    
    
    public Pet()
    {
        stamina = 10;
        exp = 0;
        level  = 1;
        points = 5;
        speech = 1;
        tongueLen = 1;
        money = 20;
        emotion = 100;
        status = 100;
        //emotion = EMOTION_SAD;
        //status = STATUS_HUNGRY;
        
        listItems = new Vector();        
        
        
       // LastPlay = System.currentTimeMillis();
    }
    public void AddAttributes(int AttType, int Increment)
    {
        switch(AttType)
        {
            case EXP:
                exp += Increment;
                if(exp >= 100)
                {
                    level ++;
                    exp = 0;
                    points += (GlobalVariables.myRandom.nextInt()%3 + 3);
                } else
                if(exp + Increment >= 0)
                    exp += Increment;
                break;
            case LEVEL:
                level += Increment;
                break;
                
            case POINTS:
                points += Increment;
                break;
                
            case SPEED:
                setSpeech(getSpeech() + Increment);
                break;
                
            case TONGUELEN:
                setTongueLen(getTongueLen() + Increment);
                break;   
            case MONEY:
                money += Increment;
                break;
        }
    }
    public int GetAttributes(int AttType)
    {
        int i = -1;
        switch(AttType)
        {
            case EXP:
                i = exp;
                break;
            case LEVEL:
                i = level;
                break;
                
            case POINTS:
                i =points;
                break;
                
            case SPEED:
                i = getSpeech();
                break;
                
            case TONGUELEN:
                i = getTongueLen();
                break;   
            case MONEY:
                i = getMoney();
                break;
        }
        return i;
    }
    public void SetAttributes(int AttType, int Value)
    {
        switch(AttType)
        {
            case EXP:
                exp = Value;
                break;
            case LEVEL:
                level = Value;
                break;
                
            case POINTS:
                points = Value;
                break;
                
            case SPEED:
                setSpeech(Value);
                break;
                
            case TONGUELEN:
                setTongueLen(Value);
                break; 
                 
            case MONEY:
                setMoney(money);
                break;
        }
    }

   

    /**
     * @return the tongueLen
     */
    public int getTongueLen() {
        return tongueLen;
    }

    /**
     * @param tongueLen the tongueLen to set
     */
    public void setTongueLen(int tongueLen) {
        this.tongueLen = tongueLen;
    }

    /**
     * @return the emotion
     */
//    public int getEmotion() {
//        return emotion;
//    }
//
//    /**
//     * @param emotion the emotion to set
//     */
//    public void setEmotion(int emotion) {
//        this.emotion = emotion;
//    }
//
//    /**
//     * @return the status
//     */
//    public int getStatus() {
//        return status;
//    }
//
//    /**
//     * @param status the status to set
//     */
//    public void setStatus(int status) {
//        this.status = status;
//    }

    /**
     * @return the money
     */
    public int getMoney() {
        return money;
    }

    /**
     * @param money the money to set
     */
    public void setMoney(int money) {
        this.money = money;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the stamina
     */
    public int getStamina() {
        return stamina;
    }

    /**
     * @param stamina the stamina to set
     */
    public void setStamina(int stamina) {
        this.stamina = stamina;
    }

    /**
     * @return the listItems
     */
    public Vector getListItems() {
        return listItems;
    }

    /**
     * @param listItems the listItems to set
     */
    public void setListItems(Vector listItems) {
        this.listItems = listItems;
    }

    /**
     * @return the speed
     */
    public int getSpeech() {
        return speech;
    }

    /**
     * @param speed the speed to set
     */
    public void setSpeech(int speed) {
        this.speech = speed;
    }

    /**
     * @return the isTired
     */
    public boolean  getIsTired() {
        return isTired;
    }

    /**
     * @param isTired the isTired to set
     */
    public void setIsTired(boolean  isTired) {
        this.isTired = isTired;
    }

    /**
     * @return the isHappy
     */
    public boolean isIsHappy() {
        return isHappy;
    }

    /**
     * @param isHappy the isHappy to set
     */
    public void setIsHappy(boolean isHappy) {
        this.isHappy = isHappy;
    }

    /**
     * @return the isFull
     */
    public boolean isIsFull() {
        return isFull;
    }

    /**
     * @param isFull the isFull to set
     */
    public void setIsFull(boolean isFull) {
        this.isFull = isFull;
    }

    /**
     * @return the status
     */
    public int getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(int status) {
        this.status = status;
    }

    /**
     * @return the emotion
     */
    public int getEmotion() {
        return emotion;
    }

    /**
     * @param emotion the emotion to set
     */
    public void setEmotion(int emotion) {
        this.emotion = emotion;
    }

   
    
    
    
}
